package com.six.vo;

import java.sql.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 调仓记录
 * 
 */
@Entity
@Table(name="WMS_T_MOVEMENT")
public class Movement {
	private int mgID;// VARCHAR(16) 记录编号
	private String mgType;// VARCHAR(16) 调仓类型
	private String mgSource;// VARCHAR(16) 源盘/原仓位
	private String mgDestination;// VARCHAR(16) 目标盘/仓位
	private int mgNum;// INTEGER 移动货物件数
	private Date mgEditTime;// DATE 记录日期
	private int mgIsDel;// SMALLINT 是否已被删除
	private User user;
	private BillDetail billDetail;
	
	public Movement() {
		super();
	}
	public Movement(int mgID, String mgType, String mgSource,
			String mgDestination, int mgNum, Date mgEditTime, int mgIsDel,
			User user, BillDetail billDetail) {
		super();
		this.mgID = mgID;
		this.mgType = mgType;
		this.mgSource = mgSource;
		this.mgDestination = mgDestination;
		this.mgNum = mgNum;
		this.mgEditTime = mgEditTime;
		this.mgIsDel = mgIsDel;
		this.user = user;
		this.billDetail = billDetail;
	}
	@Id
	@GeneratedValue
	public int getMgID() {
		return mgID;
	}
	public void setMgID(int mgID) {
		this.mgID = mgID;
	}
	public String getMgType() {
		return mgType;
	}
	public void setMgType(String mgType) {
		this.mgType = mgType;
	}
	public String getMgSource() {
		return mgSource;
	}
	public void setMgSource(String mgSource) {
		this.mgSource = mgSource;
	}
	public String getMgDestination() {
		return mgDestination;
	}
	public void setMgDestination(String mgDestination) {
		this.mgDestination = mgDestination;
	}
	public int getMgNum() {
		return mgNum;
	}
	public void setMgNum(int mgNum) {
		this.mgNum = mgNum;
	}
	public Date getMgEditTime() {
		return mgEditTime;
	}
	public void setMgEditTime(Date mgEditTime) {
		this.mgEditTime = mgEditTime;
	}
	public int getMgIsDel() {
		return mgIsDel;
	}
	public void setMgIsDel(int mgIsDel) {
		this.mgIsDel = mgIsDel;
	}
	@ManyToOne(cascade={CascadeType.ALL})           
    @JoinColumn(name="userID") 	 // VARCHAR(16) 仓管员编号
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@ManyToOne(cascade={CascadeType.ALL})           
    @JoinColumn(name="detailsID") 	 // VARCHAR(16) 业务单明细编号
	public BillDetail getBillDetail() {
		return billDetail;
	}
	public void setBillDetail(BillDetail billDetail) {
		this.billDetail = billDetail;
	}

}
